module.exports = (generator, { eslintConfig }) => {
  // answer.eslintConfig
  let otherDeps = {};
  if (eslintConfig === "airbnb") {
    otherDeps = {
      "eslint-config-airbnb-base": "^14.2.1",
      "eslint-plugin-import": "^2.22.1",
    };
  } else if (eslintConfig === "standard") {
    otherDeps = {
      "eslint-config-standard": "^16.0.2",
      "eslint-plugin-import": "^2.22.1",
      "eslint-plugin-node": "^11.1.0",
      "eslint-plugin-promise": "^4.3.1",
    };
  }
  generator.extendPackage({
    scripts: {
      lint: "eslint --ext .js,.jsx,.vue src/",
    },
    devDependencies: {
      "babel-eslint": "^10.1.0",
      eslint: "^7.20.0",
      "eslint-plugin-vue": "^7.6.0",
      ...otherDeps,
    },
  });
  // ejs render template文件
  generator.render("./template", {
    hasAirbnb: eslintConfig == "airbnb",
  });
};
